# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=armadillo
pkgver=12.6.7
pkgrel=0
pkgdesc="C++ library for linear algebra & scientific computing"
url="https://arma.sourceforge.net/"
arch="all"
license="Apache-2.0"
options="!check"  # Armadillo must be installed before the tests can be compiled
depends_dev="
	hdf5-dev
	superlu-dev
	"
makedepends="
	$depends_dev
	arpack-dev
	cmake
	openblas-dev
	samurai
	"
subpackages="$pkgname-dev"
source="https://downloads.sourceforge.net/project/arma/armadillo-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	cd "$pkgdir"
	mkdir -p usr/lib/cmake
	mv usr/share/Armadillo/CMake/* usr/lib/cmake/
	rm -rf usr/share
}

sha512sums="
bf792ab2655b1cf957a29f1bdd7a692fd75c79f4f2df1eca35d84969908784f3542b82dd5a5b0a339ab88719c2c602a175dee7fd1e9dbd2884eb19a81d061fa3  armadillo-12.6.7.tar.xz
"
